package com.sorted;

import android.app.Activity;
import android.content.Context;

import com.sorted.bridge.SortCocosBridge;


public class SortBusiness {

    public static Context context;
    public static final String GAME_MAIN_CLS = "org.cocos2dx.javascript.AppActivity";

    public static final String LIB_PATH="org.cocos2dx.lib";
    public static String COCOS2DX_ACTIVITY_PATH =   LIB_PATH.concat(".Cocos2dxActivity");
    public static String COCOS2DX_JJB_PATH      =   LIB_PATH.concat(".Cocos2dxJavascriptJavaBridge");

    public static void init(Context ctx) {
        try {
            context = ctx.getApplicationContext();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public static void onActivityCreate(Activity activity) {
        try {
            if (activity.getClass().getName().equals(GAME_MAIN_CLS)) {
                SortCocosBridge.getInstance().setMainGameActivity(activity);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
